<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.lmpop.trade.ti_redeemrules.*"%>
<%
	request.setCharacterEncoding("UTF-8");
	String srule_id = request.getParameter("rule_id");
	String user_id="";
	if( session.getAttribute("session_user_id") != null )
	{
		user_id = session.getAttribute("session_user_id").toString();
	}
	Ti_redeemrulesInfo ti_ruleInfo = new Ti_redeemrulesInfo();
	List list = ti_ruleInfo.getListByPk(srule_id);
	Hashtable map = null;
	if(list!=null && list.size()>0){
		map = (Hashtable)list.get(0);
	}
	String rule_id="",property_type="",target_type="",property_money="",target_money="";
	if(map.get("rule_id")!=null) rule_id = map.get("rule_id").toString();
	if(map.get("property_type")!=null) property_type = map.get("property_type").toString();
	if(map.get("target_type")!=null) target_type = map.get("target_type").toString();
	if(map.get("property_money")!=null) property_money = map.get("property_money").toString();
	if(map.get("target_money")!=null) target_money = map.get("target_money").toString();
%>

<html>
  <head>
    <title>兑换规则设置</title>
	<link href="/program/admin/index/css/style.css" rel="stylesheet" type="text/css">
	<script type="text/javascript" src="redeemrules.js"></script>
</head>

<body>
	<h1>换规则设置</h1>
	
	<form action="/doTradeReg.do" method="post" name="addForm">
	<table width="100%" cellpadding="0" cellspacing="1" border="0" class="listtab">
		<tr>
			<td align="left" width="100%" colspan="2" >
				<h3>请根据选择的兑换类型来制定规则</h3>
			</td>
		</tr>
		<tr>
			<td align="left" width=50%">
				财产类型
			</td>
			<td>
				目标类型
			</td>
		</tr>
		<tr>
			<td align="left" width=50%">
				<select id="sproperty_type">
					<option value="" >请选择</option>
					<option value="1" <%if(property_type.equals("1"))out.print("selected"); %>>人民币</option>
					<option value="2" <%if(property_type.equals("2"))out.print("selected"); %>>虚拟币</option>
					<option value="3" <%if(property_type.equals("3"))out.print("selected"); %> >积分</option>
				</select>
			</td>
			<td align="left" >
				<select id="starget_type">
					<option value="" >请选择</option>
					<option value="1" <%if(target_type.equals("1"))out.print("selected");%>>人民币</option>
					<option value="2" <%if(target_type.equals("2"))out.print("selected");%>>虚拟币</option>
					<option value="3" <%if(target_type.equals("3"))out.print("selected");%> >积分</option>
				</select>
			</td>
			
		</tr>
		
		<tr>
			<td align="left" width="50%">兑换数量<input name="property_money" id="property_money" type="text" value="<%=property_money %>" onKeyUp="if(!/^[0-9][0-9]*$/.test(this.value))this.value=''"/></td>
			<td>目标数量<input name="target_money" id="target_money" type="text" value="<%=target_money %>" onKeyUp="if(!/^[0-9][0-9]*$/.test(this.value))this.value=''"/></td>
		</tr>		
		
	</table>
	
	<table width="100%" cellpadding="0" cellspacing="0" border="0">
		<tr>
			<td align="center">
				<input type="hidden" id="bpm_id" name="bpm_id" value="8002" />
				<input type="hidden" id="rule_id" name="rule_id" value="<%=rule_id %>" >
				<input name="property_type" id="property_type" type="hidden" value="<%=property_type%>"/>
				<input name="target_type" id="target_type" type="hidden" value="<%=target_type%>"/>
				<input name="cust_oper_person" id="cust_oper_person" type="hidden" value="<%=user_id%>"/>
				<input type="button" class="buttoncss" name="tradeSub" value="提交" onclick="return submitForm('add');"/>&nbsp;&nbsp;
				<input type="button" class="buttoncss" name="tradeRut" value="返回" onclick="window.location.href='index.jsp';"/>
			</td>
		</tr>
	</table>
	</form>
</body>

</html>
